package com.fearless.crm.web.filter;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//拦截器
public class LoginInterceptor implements HandlerInterceptor {
    //预处理方法，在处理器方法执行之前执行
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("进入到拦截器");
        String url = request.getServletPath();
        System.out.println("url:" + url);
        request.getRequestDispatcher("/crm/login.jsp");

        return true;
    }
}
